package javase.socket.server;

import java.io.*;
import java.net.*;

public class FtpServer {
	@SuppressWarnings("resource")
	public static void main(String args[]) {
		try {
			ServerSocket ftpserver = new ServerSocket(21);
			Socket fs = ftpserver.accept();
			PrintStream fs_out = new PrintStream(fs.getOutputStream());
			DataInputStream fs_in = new DataInputStream(fs.getInputStream());
			fs_out.println("Welcome to the test server");
			System.out.println("got follow infor from client:" + fs_in.readLine());
			fs_out.println("331 Please send Password");
			System.out.println("got follow infor from client:" + fs_in.readLine());
			fs_out.println("230 Login OK");
			System.out.println("got follow infor from client:" + fs_in.readLine());
		} catch (Exception e) {
			System.out.println(e);
		}
	}
}